import axios from "axios"

const instance = axios.create({
    baseURL: "http://kumanxuan1.f3322.net:8881/cms",
    timeout: 5000
})

// 请求拦截器
instance.interceptors.request.use(config=>{
    let tok = localStorage.getItem('x-auth-token')
    if(tok){
        config.headers['x-auth-token'] = tok
    }
    return config
},err=>{
    return Promise.reject(err)
})


// 相应拦截器
instance.interceptors.response.use(config=>{
    return config
},err=>{
    return Promise.reject(err)
})
export default instance